const mongoose = require('mongoose')
const Schema = mongoose.Schema

let CartSchema = new Schema({
  opCode: String,
  opName: String,
  storeId: String,
  storeName: String,
  checked: Boolean,
  products: [
    {
      checked: Boolean,
      sku: String,
      tittle: String,
      price: Number,
      totalCount: Number,
      totalMoney: Number,
      sort: String,
      thumbnail: String,
      colors: [String],
      sizes: [
        {
          label: String,
          colors: [Number]
        }
      ]
    }
  ]
})

// Export the model
module.exports = mongoose.model('Cart', CartSchema)